package com.xwb.record.common.entity;

import java.util.List;

@SuppressWarnings("rawtypes")
public class PageInfo {

	/** 第几页 */
	private Integer page = 1;
	
	/** 每页多少条 */
    private Integer limit = 10;
    
    /** 接口状态 */
    private int code = 0;
    
    /** 提示文本 */
    private String msg = "";
    
    /** 数据长度 */
    private int count;
    
    /** 数据列表 */
	private List data;
	
	public PageInfo() {
		super();
	}
	
	public PageInfo(int count, List data) {
		super();
		this.count = count;
		this.data = data;
	}

	public PageInfo(int code, String msg, int count, List data) {
		super();
		this.code = code;
		this.msg = msg;
		this.count = count;
		this.data = data;
	}

	public Integer getPage() {
		return page;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public Integer getLimit() {
		return limit;
	}
	public void setLimit(Integer limit) {
		this.limit = limit;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public List getData() {
		return data;
	}
	public void setData(List data) {
		this.data = data;
	}
	/**
	 * mysql分页用
	 * @return
	 */
	public Integer getOffset() {
		return (this.page - 1) * this.limit;
	}
    
}
